{# 继承 layout 模板 #}
{% extends '../layout.njk' %}

{# 标题 #}
{% block title %}
修改熊猫
{% endblock%}

{# CSS #}
{% block cssLinks %}
{{ super() }}
<link rel="stylesheet" href="/css/panda.css">
{% endblock %}

{# 页面内容 #}
{% block content %}
<h3 class="title">修改熊猫</h3>
<div class="tip-message">{{ tip.message }}</div>
<div class="wrapper add-panda">
    <form action="/panda/edit" method="post">
        <input type="hidden" name="id" value="{{ panda.id or idTip.value}}">
        <div class="form-item">
            <span class="label">熊猫名称</span>
            <span class="input">
                <input type="text" name="name" value="{{ panda.name or nameTip.value }}">
            </span>
            <span class="message">{{ nameTip.message }}<span>
        </div>
         <div class="form-item">
            <span class="label">熊猫性别</span>
            <span class="input">
                {% if ( panda.gender or genderTip.value )== 'male' %}
                <input type="radio" name="gender" value="male" checked id="male-gender">
                {% else %}
                <input type="radio" name="gender" value="male" id="male-gender">
                {% endif %}
                <label for="male-gender">男</label>
                {% if ( panda.gender or genderTip.value ) == 'female' %}
                <input type="radio" name="gender" value="female" checked id="female-gender">
                {% else %}
                <input type="radio" name="gender" value="female" id="female-gender">
                {% endif %}
                <label for="female-gender">女</label>
            </span>
            <span class="message">{{ genderTip.message }}<span>
        </div>
        <div class="form-item">
            <span class="label">出生日期</span>
            <span class="input">
                <input type="date" name="birthdate" value="{{ panda.birthdate or birthdateTip.value }}">
            </span>
            <span class="message">{{ birthdateTip.message }}<span>
        </div>
        <div class="button-wrapper">
            <span class="buttons">
                <button type="reset">重置</button>
                <button type="submit">修改</button>
            <span>
        </div>
    </form>
</div>
{% endblock %}